DevForce Help Reference
LongCount<TSource>(IEntityScalarQuery<TSource>,CancellationToken) Method
Example 


Returns an Int64 that represents the total number of elements in a sequence. Pass in a System.Threading.CancellationToken to cancel operation.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function LongCount(Of TSource)( _
   ByVal source As IEntityScalarQuery(Of TSource), _
   ByVal cancellationToken As CancellationToken _
) As Task(Of Long)
'Usage
 
Dim source As IEntityScalarQuery(Of TSource)
Dim cancellationToken As CancellationToken
Dim value As Task(Of Long)
 
value = EntityScalarAsyncExtensions.LongCount(Of TSource)(source, cancellationToken)

Parameters

source
cancellationToken

Type Parameters

TSource
Example
public async void AsyncLongCount() {
  long orderCount = await _entityManager.OrderSummaries.AsScalarAsync().LongCount();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityScalarAsyncExtensions Class
EntityScalarAsyncExtensions Members
Overload List

Send Feedback